package main
import "fmt"

func main(){
	//定义map：
	b := make(map[int]string)
	//增加：
	b[2001] = "Lee"
	b[2002] = "Lh"
	b[2003] = "lh"

	//获取长度
	fmt.Println(len(b))

	//遍历：
	for k,v := range b{
		fmt.Printf("b[%d]=%s \n",k,v)
	}

	//加深难度：
	a := make(map[string]map[int]string)
	//赋值：
	a["班级1"] = make(map[int]string,3)
	a["班级1"][2001] = "张三"
	a["班级1"][2002] = "李四"
	a["班级1"][2003] = "王五"

	a["班级2"] = make(map[int]string,3)
	a["班级2"][2001] = "小温"
	a["班级2"][2002] = "小军"
	a["班级2"][2003] = "小雷"
	a["班级2"][2004] = "小龙"

	// fmt.Println(a)
	for class,students := range a{
		// fmt.Printf("%s %v \n",k,v)
		fmt.Printf("------------%s----------------\n",class)
		for num,name := range students{
			fmt.Printf("学号：%d---姓名：%s\n",num,name)
		}
	}
}